//
//  ChooseIsokTableViewCell.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/11/8.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "ChooseIsokTableViewCell.h"

@implementation ChooseIsokTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setIsEnableEdit:(BOOL)isEnableEdit
{
    _isEnableEdit=isEnableEdit;
    
    self.PassBtn.userInteractionEnabled=isEnableEdit;
    
    self.NotPassBtn.userInteractionEnabled=isEnableEdit;
    
    self.NotSuitBtn.userInteractionEnabled=isEnableEdit;

}

- (IBAction)PassAction:(UIButton *)sender {
    
    sender.selected=YES;
    
    self.NotPassBtn.selected=NO;
    self.NotSuitBtn.selected=NO;
    
    _block(1);
    
}
- (IBAction)NotPassAction:(UIButton *)sender {
    
     sender.selected=YES;
    
     self.PassBtn.selected=NO;
     self.NotSuitBtn.selected=NO;
    
    _block(0);
    
}
- (IBAction)NotSuitAction:(UIButton *)sender {
    
     sender.selected=YES;
    
      self.NotPassBtn.selected=NO;
    
    self.PassBtn.selected=NO;
    
    _block(2);
    
}

-(void)setIsok:(NSInteger)isok
{
    _isok=isok;
    
    if (isok==0) {
        
        self.NotPassBtn.selected=YES;
        
         self.PassBtn.selected=NO;
        
         self.NotSuitBtn.selected=NO;
        
    }else if (isok==1)
    {
        
         self.PassBtn.selected=YES;
        
        self.NotPassBtn.selected=NO;
        
         self.NotSuitBtn.selected=NO;
        
    }else{
        
        
         self.NotSuitBtn.selected=YES;
        
        self.NotPassBtn.selected=NO;
        
         self.PassBtn.selected=NO;
    }
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
